'''
Created on 10.04.2012
'''
import unittest
import dtaus.const.setA as sa
import dtaus.const.setC as sc
import dtaus.const.setE as se

class Test(unittest.TestCase):
    
    def setUp(self):
        pass

    def test_setA(self):
        self.assertEqual(len(sa.type_of_set), 1, 'setA: type_of_set(A) has wrong lenth')
        for ttk in sa.transactiontype.keys():
            ttv = sa.transactiontype[ttk]
            self.assertEqual(len(ttv), 2, 'setA: transactiontype [%s] as wrong length' % ttk)


    def test_setC(self):
        self.assertEqual(len(sc.type_of_set), 1, 'setC: type_of_set has wrong lenth')
        #test length of all textschluessel_ergaenzung values
        for txte in sc.textschluessel_ergaenzung.values():
            self.assertEqual(len(txte), 3, 'TXT-extension has wrong size')
        #test length of all textextension_prefixes
        for txep in sc.textextension_prefix.values():
            self.assertEqual(len(txep), 2)
        #consistency of max_textextensions
        for mte in sc.max_textextensions.keys():
            if len(mte) > 2:
                directvalue = sc.max_textextensions[mte]
                indirectvalue = sc.max_textextensions[sc.textextension_prefix[mte]]
                self.assertEqual(directvalue,indirectvalue)

    def test_setE(self):
        self.assertEqual(len(se.type_of_set), 1, 'setE: type_of_set has wrong lenth')
        
    

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()